home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / qwik40.arc / QWIKDEMO.PAS < prev    next >
Pascal/Delphi Source File  |  1991-01-09  |  17KB  |  492 lines

  1. { QwikDemo.pas - Demo program for QWIK screen utilities.    ver 4.0, 12-01-87 }
  2. { Demo has been programmed best for color cards.  EGA and VGA should be in
  3.   25-line mode. }
  4.  
  5. program QwikDemo;
  6.  
  7. uses
  8.   Crt, {$U Qwik40.tpu} Qwik;
  9.  
  10. type
  11.   BrdrRec = record                 { For Qbox procedure }
  12.               TL,TH,TR,LV,RV,BL,BH,BR: char;
  13.             end;
  14.  
  15. var
  16.   Row,Rows,Col,Cols,Step,ColMax: byte;
  17.   i,Count,
  18.   OldCursor,Fgrnd,Bgrnd:       word;
  19.   BrdrAttr, WndwAttr:          integer;
  20.   SavedBlock, PopUpBlock: array [1..4000] of byte;
  21.   BlkRow,BlkCol,V:               byte;
  22.   ColL,ColR: array [1..3] of byte;
  23.   Strng,Strng2,NumStr:   string[75];
  24.   Data: array [1..9 ] of string[40];
  25.   PC:   array [1..13] of string[40];
  26.   Init: array [1.. 8] of string[40];
  27.   Other:array [1..14] of string[40];
  28.   Rnum:                  Real;
  29.   Ch:                    char;
  30.  
  31. const      { These are double lines for Qbox }
  32.   Border: BrdrRec =  (TL:'╔';TH:'═';TR:'╗';
  33.                       LV:'║';       RV:'║';
  34.                       BL:'╚';BH:'═';BR:'╝');
  35.   BWcolors: array[0..3] of byte = (
  36.               0,    { Black     on Black }
  37.               7,    { LightGray on Black }
  38.             $0F,    { White     on Black }
  39.             $70);   { Black     on LightGray }
  40.   Wait: word = 500;           { One unit of wait in milliseconds for demo. }
  41.  
  42. { Qbox is an application of QWIK screen utilities.  It can make fast
  43.   pop-up menus.  See WINDOWxx.ARC for more applications. }
  44. procedure Qbox (Row,Col,Rows,Cols: byte; WndwAttr,BrdrAttr: integer;
  45.                                                       Brdr: BrdrRec);
  46. begin
  47.   if (Rows>=2) and (Cols>=2) then
  48.   begin
  49.     with Brdr do
  50.     begin
  51.       Qwrite (Row       ,Col                     ,BrdrAttr,TL);
  52.       Qfill  (Row       ,Col+1     ,1     ,Cols-2,BrdrAttr,TH);
  53.       Qwrite (Row       ,Col+Cols-1              ,BrdrAttr,TR);
  54.       Qfill  (Row+1     ,Col       ,Rows-2,1     ,BrdrAttr,LV);
  55.       Qfill  (Row+1     ,Col+Cols-1,Rows-2,1     ,BrdrAttr,RV);
  56.       Qwrite (Row+Rows-1,Col                     ,BrdrAttr,BL);
  57.       Qfill  (Row+Rows-1,Col+1     ,1     ,Cols-2,BrdrAttr,BH);
  58.       Qwrite (Row+Rows-1,Col+Cols-1              ,BrdrAttr,BR);
  59.       Qfill  (Row+1     ,Col+1     ,Rows-2,Cols-2,WndwAttr,' ')
  60.     end
  61.   end
  62. end;
  63.  
  64. procedure PromptKey;
  65. begin
  66.   Qwrite (25,CRTcols-19,-1,'press any key ...');
  67.   Ch:=ReadKey;
  68.   if Ch=#00 then Ch:=ReadKey;
  69. end;
  70.  
  71. procedure CheckCursor;
  72. var CursorMode: integer absolute $0040:$0060;
  73. begin
  74.   if ActiveDispDev=MdaMono then
  75.     if CursorMode=$0607 then
  76.       CursorChange($0B0C,OldCursor);
  77. end;
  78.  
  79. function Attr (ForeGround,BackGround: byte): byte;
  80. begin
  81.   Attr := ((BackGround shl 4) + ForeGround) and 127;
  82. end;
  83.  
  84. procedure ExplodeScreen;
  85. var
  86.   TopRow,BottomRow,MaxRows,MaxCols,DeltaCols,LeftCol,RightCol: byte;
  87.   CenterCol: byte;
  88.   MaxCount:  word;
  89. begin
  90.   CenterCol:=CRTcols shr 1;
  91.   randomize;
  92.   MaxCount:=40;
  93.   for Step:=1 to 12 do
  94.     begin
  95.       { Set boundaries }
  96.       TopRow:=13-Step;
  97.       BottomRow:=13+Step;
  98.       MaxRows:=Step;
  99.       if VideoMode<=CO40 then                      { Keep aspect 1:1 }
  100.         begin
  101.           MaxCols:= MaxRows + MaxRows shr 2;       { 1.2 cols/row }
  102.           DeltaCols:=(Step*5 div 3);
  103.         end
  104.       else
  105.         begin
  106.           MaxCols:= MaxRows shl 1 + MaxRows shr 1;  { 2.4 cols/row }
  107.           DeltaCols:=(Step*10 div 3);
  108.         end;
  109.       LeftCol  :=succ(CenterCol)-DeltaCols;
  110.       RightCol :=CenterCol+DeltaCols;
  111.       if Step=12 then MaxCount:=400;
  112.       for Count:=1 to MaxCount do
  113.         begin
  114.           Rows:= succ(random(MaxRows));
  115.           if VideoMode<=CO40 then               { Keep aspect 1:1 }
  116.                Cols:= Rows + Rows shr 2         { 1.2 cols/row }
  117.           else Cols:= Rows shl 1 + Rows shr 1;  { 2.4 cols/row }
  118.           Col := LeftCol + random (RightCol-LeftCol-Cols+2);
  119.           Row := TopRow  + random (BottomRow-TopRow-Rows+2);
  120.           if VideoMode=Mono then
  121.             TextAttr:=BWcolors[(random(4))]
  122.           else
  123.             begin
  124.               Fgrnd:= random (16);
  125.               Bgrnd:= random (8);
  126.               if Bgrnd=Fgrnd then inc(Fgrnd);
  127.               TextAttr:=Attr(Fgrnd,Bgrnd);
  128.             end;
  129.           Qfill (Row,Col,Rows,Cols,TextAttr,#178);
  130.         end
  131.     end;
  132. end;
  133.  
  134. begin
  135. { --- Set up data --- }
  136. { If you set a mode, do it first before Qinit! }
  137. { Please!  Test a mode first to see if it is different than what you want; }
  138. { then change if necessary.  Otherwise, the screen jumps. }
  139.  
  140.   if (VideoMode<>Mono) and not Have3270 then
  141.     begin
  142.       Qfill   (1,1,25,CRTcols,7,' ');
  143.       QwriteC (11,1,CRTcols,-1,'(1) 40 column mode');
  144.       QwriteC (12,1,CRTcols,-1,'(2) 80 column mode');
  145.       QwriteC (14,1,CRTcols,-1,'Which mode [1,2]? ');
  146.       GotoRC  (14,CRTcols div 2 + 9);
  147.       repeat
  148.         Ch:=ReadKey;
  149.       until ch in ['1','2'];
  150.       V:=VideoMode;
  151.       case ch of
  152.         '1': case V of
  153.                BW80: V:=BW40;
  154.                CO80: V:=CO40;
  155.              end;
  156.         '2': case V of
  157.                BW40: V:=BW80;
  158.                CO40: V:=CO80;
  159.              end;
  160.       end;
  161.       if V<>VideoMode then
  162.         begin
  163.           TextMode(V);
  164.           Qinit;           { << Do Qinit again after change of mode!! }
  165.         end;
  166.     end;
  167.   Strng:=   ' Q Screen Utilities ';
  168.   Strng2:=  ' QWIK Screen Utilities  ';
  169.   Data[1]:= '1';
  170.   Data[2]:= '22';
  171.   Data[3]:= '333';
  172.   Data[4]:= Strng;
  173.   Data[5]:= 'Odd  Length';
  174.   Data[6]:= 'Even  Length';
  175.   Data[7]:= '18 characters wide';
  176.   Data[8]:= '19 characters width';
  177.   Data[9]:= 'Margin to Margin width';
  178.   PC[1]:=  'COMPUTERS:           ADAPTERS:';
  179.   PC[2]:=  '------------------   ----------';
  180.   PC[3]:=  'IBM PC               MDA';
  181.   PC[4]:=  'IBM XT               CGA';
  182.   PC[5]:=  'IBM AT               EGA';
  183.   PC[6]:=  'IBM PCjr             MCGA';
  184.   PC[7]:=  'IBM PC Convertible   VGA';
  185.   PC[8]:=  'IBM PS/2 Model 25    8514/A';
  186.   PC[9]:=  'IBM PS/2 Model 30    Hercules:';
  187.   PC[10]:= 'IBM PS/2 Model 50      HGC';
  188.   PC[11]:= 'IBM PS/2 Model 60      HGC Plus';
  189.   PC[12]:= 'IBM PS/2 Model 80      InColor';
  190.   PC[13]:= 'IBM 3270 PC';
  191.   Other[1]:='QwriteA    - for arrays/partial strings';
  192.   Other[2]:='QfillC     - a self-centering Qfill';
  193.   Other[3]:='QattrC     - a self-centering Qattr';
  194.   Other[4]:='QviewPage  - view any video page';
  195.   Other[5]:='QwritePage - write to any video page';
  196.   Other[6]:='';
  197.   Other[7]:='GotoRC       - position absolute cursor';
  198.   Other[8]:='CursorChange - change cursor shape';
  199.   Other[9]:='CursorOff    - turns off cursor';
  200.   Other[10]:='CursorOn     - turns on  cursor';
  201.   Other[11]:='WhereR       - absolute cursor row';
  202.   Other[12]:='WhereC       - absolute cursor column';
  203.   Other[13]:='A total of 18 utilities';
  204.   Other[14]:='compiling in only 1.6k bytes!';
  205.   Init[1]:='∙ Detects dual monitor/adapters for all';
  206.   Init[2]:='   systems listed on the previous page';
  207.   Init[3]:='∙ Identifies each system by name';
  208.   Init[6]:='∙ Gets System ID and Submodel ID';
  209.   Init[4]:='∙ Sets video buffer segment';
  210.   Init[5]:='∙ Determines need for wait-for-retrace';
  211.   Init[7]:='∙ Gets screen dimensions: Row by Cols';
  212.   Init[8]:='∙ Determines the number of video pages';
  213.  
  214. { --- Initial screen --- }
  215.   CheckCursor;
  216.   CursorOff;
  217.   Qfill   ( 1, 1,25,CRTcols,Attr(white,blue),' ');      {  Clear Screen }
  218.   QwriteC (11, 1,CRTcols,Attr(yellow,blue), Strng2);
  219.   QwriteC (13, 1,CRTcols, -1,'Your screen is about to explode.');
  220.   QwriteC (14, 1,CRTcols, -1,'Hold on to your seat ...');
  221.   Delay   (Wait*5);
  222.  
  223. { --- Explosion of Boxes --- }
  224.   Qfill    (11, 1, 4,CRTcols, -1,' ');                {  Clear Lines }
  225.   Qattr    ( 1, 1,25,CRTcols,Attr(black,lightgray));  {  New screen attribute }
  226.   ExplodeScreen;
  227.  
  228.   QfillC  (10, 1,CRTcols, 6,34,Red   shl 4,' ');
  229.   QfillC  (11, 1,CRTcols, 4,30,Brown shl 4,' ');
  230.   TextAttr:= Attr(yellow,red);
  231.   QwriteC (12, 1,CRTcols,TextAttr,Strng2);
  232.   QwriteC (13, 1,CRTcols,TextAttr,'      Version  4.0      ');
  233.  
  234.   { --- Save Screen for Page Demo --- }
  235.   if MaxPage>0 then
  236.    begin
  237.      QstoreToMem ( 1, 1,25,CRTcols,SavedBlock);
  238.      QwritePage  (1);
  239.      QstoreToScr ( 1, 1,25,CRTcols,SavedBlock);
  240.      QwritePage  (0);
  241.    end;
  242.   { --- End of Save Screen --- }
  243.   Delay   (Wait*4);
  244.   TextAttr:= Attr(white,blue);
  245.   QwriteC ( 6, 1,CRTcols,TextAttr,' Qwrite will write with new attributes  ');
  246.   QwriteC ( 7, 1,CRTcols,TextAttr,' that you specify direct to the screen. ');
  247.   Delay   (Wait*6);
  248.   QwriteC (18, 1,CRTcols, -1,'Qwrite will also use existing attributes');
  249.   QwriteC (19, 1,CRTcols, -1,'   when you do not even know or care.   ');
  250.                         { highlight the word 'existing' }
  251.   QattrC  (18, 6,CRTcols+5,1,10,Attr(white,lightred));
  252.   Delay   (wait*10);
  253.   QwriteC (21, 1,CRTcols,TextAttr,' Say Goodbye to this screen. ');
  254.  
  255.   Delay   (wait*3);
  256.   { --- Disintigrate Screen --- }
  257.   for i:=1 to 5000 do
  258.   begin
  259.     Row:=random(25)+1;
  260.     Col:=random(CRTcols)+1;
  261.     Qfill (row,col, 1, 1,Black,' ');
  262.   end;
  263.  
  264. { --- Compatible computer and adapter list --- }
  265.   Qfill   ( 1, 1,25,CRTcols,white,' ');       {  Clear Screen }
  266.   QwriteC ( 4, 1,CRTcols, -1,'QWIK Screen Utilities detects these IBM');
  267.   QwriteC ( 5, 1,CRTcols, -1,'or compatible computers and adapters:');
  268.   delay   (wait*5);
  269.   Col:=(CRTcols-30) shr 1;
  270.   for Row:=7 to 19 do
  271.     Qwrite (Row,Col, -1,PC[Row-6]);
  272.   QwriteC ( 22, 1,CRTcols, -1,'Working text modes 0,1,2,3, or 7!');
  273.   PromptKey;
  274.  
  275. { --- Qinit detection --- }
  276.   Qfill   ( 1, 1,25,CRTcols,Attr(black,lightgray),' ');   {  Clear Screen }
  277.   QwriteC ( 4, 1,CRTcols, -1,'To configure QWIK, Qinit not only');
  278.   QwriteC ( 5, 1,CRTcols, -1,'detects computers/adapters, it:');
  279.   delay   (wait*5);
  280.   Col:=(CRTcols-36) shr 1;
  281.   for Row:=11 to 18 do
  282.     Qwrite (Row,Col, -1,Init[Row-10]);
  283.   PromptKey;
  284.  
  285. { --- Qwrite with Str on Reals Demo --- }
  286.   Qfill   ( 1, 1,25,CRTcols,yellow,' ');       {  Clear Screen }
  287.   QwriteC ( 2, 1,CRTcols, -1,'Qwrite with Turbo''s Str will write');
  288.   QwriteC ( 3, 1,CRTcols, -1,'reals and integers faster:');
  289.   Delay   (wait*7);
  290.   Rnum:=1.23E+05;
  291.   for col:=0 to CRTcols div 20 -1 do
  292.   for row:=5 to 24 do
  293.   begin
  294.     Rnum:=Rnum+1;
  295.     Str(Rnum:12,NumStr);
  296.     Qwrite (row,col*20+4, -1,NumStr);
  297.   end;
  298.   PromptKey;
  299.  
  300. { --- Centering Demo --- }
  301.   Qfill   ( 1, 1,25,CRTcols,Attr(black,lightgray),' ');       {  Clear Screen }
  302.   QwriteC ( 2, 1,CRTcols, -1,'QwriteC will automatically');
  303.   QwriteC ( 3, 1,CRTcols, -1,'center your data ...');
  304.   QwriteC ( 4, 1,CRTcols, -1,'(Odd breaks are shifted to the left.)');
  305.   Delay   (wait*6);
  306.  
  307.   { - Set up columns for varying column modes - }
  308.   ColL[2]:=1; ColR[2]:=CRTcols;
  309.   if CRTcols<80 then
  310.   begin
  311.     ColL[1]:=ColL[2]; ColL[3]:=CRTcols div 2;
  312.     ColR[1]:=ColR[2]; ColR[3]:=CRTcols div 2;
  313.   end
  314.   else
  315.   begin
  316.     ColL[1]:=3; ColR[1]:=26; ColL[3]:=CRTcols-14; ColR[3]:=CRTcols-14;
  317.   end;
  318.  
  319.   QwriteC ( 7,ColL[1],ColR[1], -1,'between margins ...');
  320.   Qbox    ( 8,(ColL[1]+ColR[1]) shr 1 -12,15,26,white,LightGray,Border);
  321.   Delay   (wait*3);
  322.   for row:=11 to 19 do
  323.     QwriteC (row,ColL[1],ColR[1], -1, Data[row-10]);
  324.   Delay   (wait*5);
  325.  
  326.   QwriteC ( 7,ColL[2],ColR[2], -1,'between two columns ...');
  327.   QfillC  ( 9,ColL[2],ColR[2],13,24,yellow,' ');     {  Clear window }
  328.   for row:= 9 to 21 do
  329.     QwriteC  (row,ColL[2],ColR[2], -1,'><');         {  Show two columns  }
  330.   Delay   (wait*3);
  331.   for row:=11 to 19 do
  332.     QwriteC (row,ColL[2],ColR[2],LightRed, Data[row-10]);
  333.   Delay   (wait*5);
  334.  
  335.   QwriteC ( 7,ColL[3],ColR[3], -1,'or on a center line ...');
  336.   QfillC  ( 8,ColL[3],ColR[3],15,27,Attr(black,lightgray),' ');  {Clear window}
  337.   for row:=09 to 21 do                 {  Show center line  }
  338.     QwriteC  (row,ColL[3],ColR[3],Attr(black,lightgray),'|');
  339.   Delay   (wait*3);
  340.   for row:=11 to 19 do
  341.     QwriteC (row,ColL[3],ColR[3], -1, Data[row-10]);
  342.   PromptKey;
  343.  
  344. { --- Qfill Demo --- }
  345.   Qfill   ( 1, 1,25,CRTcols,white,' ');       {  Clear Screen }
  346.   QwriteC ( 2, 1,CRTcols, -1,'Qfill as well as Qattr can fill');
  347.   QwriteC ( 3, 1,CRTcols, -1,'your screen in several ways.');
  348.   Delay   (wait*7);
  349.  
  350.   QwriteC ( 7, 1,CRTcols, -1,'by rows ...');
  351.   Delay   (wait*3);
  352.   for row:= 9 to 24 do
  353.     Qfill (row, 2, 1,CRTcols-2,9+row,Chr(row+56));
  354.   Delay   (wait*5);
  355.  
  356.   Qfill   ( 7, 1,19,CRTcols,white,' ');       {  Clear Lines }
  357.   QwriteC ( 7, 1,CRTcols, -1,'by columns ...');
  358.   Delay   (wait*3);
  359.   for col:=2 to CRTcols-2 do
  360.     Qfill ( 9,col,16,1,16+col,chr(col+63));
  361.   Delay   (wait*5);
  362.  
  363.   Qfill   ( 7, 1,19,CRTcols,white,' ');       {  Clear Lines }
  364.   QwriteC ( 7, 1,CRTcols, -1,'or by row-by-column blocks ...');
  365.   Delay   (wait*3);
  366.     Qfill ( 9,2,16,CRTcols-2,Attr(yellow,blue),'!');
  367.   Delay   (wait*5);
  368.  
  369. { --- Qbox demo --- }
  370.   Qfill   ( 1, 1,25,CRTcols,Attr(black,lightgray),' ');       {  Clear Screen }
  371.   QwriteC ( 2, 1,CRTcols, -1,'Qbox is an application procedure made');
  372.   QwriteC ( 3, 1,CRTcols, -1,'from Qwrite and Qfill.  Together they');
  373.   QwriteC ( 4, 1,CRTcols, -1,'can make windows with borders easy.');
  374.   Delay   (wait*9);
  375.   QwriteC (14, 1,CRTcols, -1,'How about 100 of them? ... ');
  376.   Delay   (wait*4);
  377.   ColMax:=CRTcols-21;
  378.   for i:=1 to 100 do
  379.   begin
  380.     row:=random (10)+6;
  381.     col:=random (ColMax)+2;
  382.     if VideoMode=Mono then
  383.       begin
  384.         BrdrAttr:=BWcolors[random(4)];
  385.         WndwAttr:=BWcolors[random(4)];
  386.       end
  387.     else
  388.       begin
  389.         BrdrAttr:=random (128);
  390.         WndwAttr:=random (128);
  391.       end;
  392.     Qbox (row,col,10,20,BrdrAttr,WndwAttr,Border);
  393.   end;
  394.   Delay   (wait*10);
  395.  
  396. { --- Block Transfer and PopUp Demo --- }
  397.   Qfill   ( 1, 1,25,CRTcols,yellow,'?');       {  Clear Screen }
  398.   QfillC  (10, 1,CRTcols, 6,40,Brown shl 4,' ');    {  Clear Block }
  399.   QwriteC (11, 1,CRTcols, -1,'Qstore will save and restore');
  400.   QwriteC (12, 1,CRTcols, -1,'Row-by-Column blocks on your display.');
  401.   QwriteC (13, 1,CRTcols, -1,'It is so fast, I have to slow it down');
  402.   QwriteC (14, 1,CRTcols, -1,'so you can see it.');
  403.     Delay (wait*11);
  404.     BlkRow:=8;
  405.     BlkCol:=CRTcols div 2 - 9;
  406.   QstoreToMem(BlkRow,BlkCol,10,20,SavedBlock);
  407.   { --- Make a Pop Up Menu --- }
  408.   Qbox (BlkRow,BlkCol,10,20,Attr(yellow,blue),Attr(brown,blue),Border);
  409.   QwriteC (BlkRow+4,BlkCol,BlkCol+20, -1,'Pop Up');
  410.   QwriteC (BlkRow+5,BlkCol,BlkCol+20, -1,'Menu');
  411.   { --- End of Pop Up Menu --- }
  412.   QstoreToMem(BlkRow,BlkCol,10,20,PopUpBlock);
  413.     Delay (wait*4);
  414.   ColMax:=CRTcols-20;
  415.   for i:=1 to 30 do
  416.   begin
  417.     Delay (Wait div 2);
  418.     QstoreToScr(BlkRow,BlkCol,10,20,SavedBlock);
  419.     BlkRow:=random(15)+1;
  420.     BlkCol:=random(ColMax)+1;
  421.     QstoreToMem(BlkRow,BlkCol,10,20,SavedBlock);
  422.     QstoreToScr(BlkRow,BlkCol,10,20,PopUpBlock);
  423.   end;
  424.  
  425. { --- Page Demo --- }
  426.   if MaxPage>0 then
  427.   begin
  428.     QviewPage  (1);
  429.     QwritePage (1);
  430.     TextAttr:= Attr(yellow,blue);
  431.     QwriteC (20, 1,CRTcols,TextAttr,' Remember this page?  ');
  432.     QwriteC (21, 1,CRTcols,TextAttr,' It wasn''t destroyed, but saved using ');
  433.     QwriteC (22, 1,CRTcols,TextAttr,' Qstores and placed on a new page. ');
  434.     Delay (wait*14);
  435.     QwritePage (0);
  436.     QviewPage  (0);
  437.   end;
  438.  
  439. { --- Other Utilities Demo --- }
  440.   Qfill   ( 1, 1,25,CRTcols,white,' ');       {  Clear Screen }
  441.   QwriteC ( 4, 1,CRTcols, -1,'Here are more handy');
  442.   QwriteC ( 5, 1,CRTcols, -1,'QWIK Screen Utilities:');
  443.   delay   (wait*5);
  444.   Col:=(CRTcols-38) shr 1;
  445.   for Row:=8 to 19 do
  446.     Qwrite (Row,Col, -1,Other[Row-7]);
  447.   for Row:=21 to 22 do
  448.     QwriteC (Row,1,CRTcols,-1,Other[Row-8]);
  449.   PromptKey;
  450.  
  451. { --- Attribute Demo --- }
  452.   Qfill   ( 1, 1,25,CRTcols,Attr(green,green),' ');    {  Clear Screen }
  453.   TextAttr:= Attr(white,green);
  454.   QwriteC ( 2, 1,CRTcols,TextAttr,'QWIK Screen Utilities are hiding data');
  455.   QwriteC ( 3, 1,CRTcols,TextAttr,'on your screen ...');
  456.   Cols:=CRTcols div 20;
  457.   if VideoMode=7 then TextAttr:=0 else TextAttr:= Attr(green,green);
  458.   for col:=0 to Cols-1 do
  459.   for row:=5 to 20 do
  460.     Qwrite (row,20*col+1,TextAttr,Strng);
  461.   Delay   (wait*8);
  462.  
  463.   Qfill   ( 2, 1, 2,CRTcols,-1,' ');        {  Clear Lines }
  464.   TextAttr:= Attr(white,green);
  465.   QwriteC ( 2, 1,CRTcols,TextAttr,'Qattr can show them -');
  466.   QwriteC ( 3, 1,CRTcols,TextAttr,'by merely changing the attribute!');
  467.   Delay   (wait*6);
  468.  
  469.   { --- Try using Turbo's color procedures this time --- }
  470.   TextColor (Black); TextBackground (Green);
  471.   Qattr   ( 5, 1,16,CRTcols,TextAttr);         {  Reveal Data }
  472.   Delay   (wait*5);
  473.  
  474.   Qfill   ( 2, 1, 2,CRTcols,-1,' ');        {  Clear Lines }
  475.   TextColor (yellow); TextBackground (Green);
  476.   QwriteC ( 2, 1,CRTcols,TextAttr,'Or even just emphasize what''s seen ...');
  477.   for i:=1 to 500 do
  478.   begin
  479.     Row:= random(16) + 5;
  480.     Col:= random(Cols)*20+1;
  481.     Qattr (Row,Col, 1,20,46);
  482.     Delay (3);
  483.     Qattr (Row,Col, 1,20,32);
  484.   end;
  485.   for i:=1 to Cols do     {  Emphasize Data }
  486.     Qattr ( 5*i,(i-1)*20+1, 1,20,yellow + (lightgreen shl 4));
  487.   Qattr   (21, 1, 5,CRTcols,TextAttr);
  488.   QwriteC (22, 1,CRTcols,TextAttr,' (c) 1986,1987 James H. LeMay ');
  489.   GotoRC  (23, 1);
  490.   CursorOn;
  491. end.
  492.